From 115488f1ea6f28cd860c97709b86255575be1131 Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild2.aw" Date: Thu, 8 Mar 2007 09:50:25 -0700 Subject: [PATCH] [IA64] Add HYPERVISOR_vcpu_op For support of steal time accounting, only supports VCPUOP_register_runstate_memory_area right now. Signed-off-by: Atsushi SAKAI --- .../arch/ia64/xen/xcom_hcall.c | 18 ++++++++++++++++++ .../include/asm-ia64/hypercall.h | 7 +++++++ .../include/asm-ia64/xen/xcom_hcall.h | 2 ++ 3 files changed, 27 insertions(+) diff --git a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c index 49f9ea6708..135a9e1533 100644 --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -363,3 +364,20 @@ xencomm_hypercall_perfmon_op(unsigned long cmd, void* arg, unsigned long count) xencomm_create_inline(arg), count); } + +long +xencomm_hypercall_vcpu_op(int cmd, int cpu, void *arg) +{ + switch (cmd) { + case VCPUOP_register_runstate_memory_area: + xencommize_memory_reservation((xen_memory_reservation_t *)arg); + break; + + default: + printk("%s: unknown vcpu op %d\n", __func__, cmd); + return -ENOSYS; + } + + return xencomm_arch_hypercall_vcpu_op(cmd, cpu, + xencomm_create_inline(arg)); +} diff --git a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h index 9ae66fe781..62073e6950 100644 --- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h @@ -205,6 +205,12 @@ xencomm_arch_hypercall_hvm_op(int cmd, void *arg) return _hypercall2(unsigned long, hvm_op, cmd, arg); } +static inline long +xencomm_arch_hypercall_vcpu_op(int cmd, int cpu, void *arg) +{ + return _hypercall3(long, vcpu_op, cmd, cpu, arg); +} + static inline int HYPERVISOR_physdev_op(int cmd, void *arg) { @@ -405,5 +411,6 @@ xencomm_arch_hypercall_perfmon_op(unsigned long cmd, #endif #define HYPERVISOR_suspend xencomm_hypercall_suspend +#define HYPERVISOR_vcpu_op xencomm_hypercall_vcpu_op #endif /* __HYPERCALL_H__ */ diff --git a/linux-2.6-xen-sparse/include/asm-ia64/xen/xcom_hcall.h b/linux-2.6-xen-sparse/include/asm-ia64/xen/xcom_hcall.h index 79e790d75b..913f2761ee 100644 --- a/linux-2.6-xen-sparse/include/asm-ia64/xen/xcom_hcall.h +++ b/linux-2.6-xen-sparse/include/asm-ia64/xen/xcom_hcall.h @@ -51,6 +51,8 @@ extern int xencomm_hypercall_xenoprof_op(int op, void *arg); extern int xencomm_hypercall_perfmon_op(unsigned long cmd, void* arg, unsigned long count); +extern long xencomm_hypercall_vcpu_op(int cmd, int cpu, void *arg); + /* Using mini xencomm. */ extern int xencomm_mini_hypercall_console_io(int cmd, int count, char *str); -- 2.30.2